//
//  SEGUserFeedbackViewModel.m
//  SEGViewModel
//
//  Created by 山刘 on 2020/6/1.
//

#import "SEGUserFeedbackViewModel.h"
#import "SEGUserFeedbackManager.h"

@implementation SEGUserFeedbackViewModel
#pragma mark - business
-(void)requestFeedbackList:(void(^)(NSString* code))completed{
    [SEGUserFeedbackManager requestFeedbackList:^(id result, NSError* error) {
        NSString* code = [result objectForKey:@"code"];
        if ([code isEqualToString:@"0"]) {
            NSDictionary* data = [result objectForKey:@"data"];
            self.listData = [data objectForKey:@"result"];
        }
        completed(code);
    }];
}
#pragma mark - getter
-(NSArray *)listData{
    if (!_listData) {
        _listData = [NSArray new];
    }
    return _listData;
}
@end

